import QtQuick 2.0
import "../logic.js" as Logic;

ImgBtn {
	id: prop
	showAni: true
	property int type: -1
	property int rAniLoopTime: Animation.Infinite

	SequentialAnimation {
		id: rani
		running: false
		PropertyAnimation {
			target: prop
			property: "rotation"
			duration: 200
			to: 30
		}
		SequentialAnimation {
			loops: rAniLoopTime
			PropertyAnimation {
				target: prop
				property: "rotation"
				duration: 400
				to: -30
			}
			PropertyAnimation {
				target: prop
				property: "rotation"
				duration: 400
				to: 30
			}
		}
		onStopped: prop.rotation = 0;
	}

	function runRAni(r)
	{
		if (r)
			rani.start();
		else
			rani.stop();
	}

	onClicked: Logic.propFunc(this);
}
